﻿<!--
Author: Christoph van der Fecht
CodePlex: http://www.codeplex.com/site/users/view/ChristophvdF

Copyright(c) Christoph van der Fecht
-->
<Window x:Class="SerienNewsReader.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{Binding Path=WindowTitle}"
        Height="550"
        Width="950" 
        Name="NewsReader"
        DataContext="{Binding Main, Source={StaticResource Locator}}">

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Skins/MainSkin.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="25"/>
            <RowDefinition Height="29"/>
            <RowDefinition Height="277"/>
            <RowDefinition Height="9*" />
        </Grid.RowDefinitions>

        <!--Menu-->
        <Menu Grid.Row="0">
            <MenuItem x:Name="menuItemFilters" 
                      Header="Filters" 
                      IsEnabled="True"
                      ItemsSource="{Binding Path=Menu}">

                <!--<Separator/>
                <MenuItem x:Name="menuItemAll" Header="All my series" IsCheckable="True" Click="menuItemAllSeries_Click"/>-->
            </MenuItem>
            <MenuItem x:Name="menuItemExtra" 
                      Header="Extra"
                      Command="{Binding Path=ShowOptions}">
                <!--<MenuItem x:Name="menuItemOptions" Header="Options" Click="menuItemOptions_Click"/>-->
            </MenuItem>
        </Menu>
        <!--Search-->
        <StackPanel Orientation="Horizontal" Grid.Row="1">
            <TextBlock Text="Search:" Margin="5,3,5,0"/>
            <TextBox x:Name="textBoxFilter"  Width="177" Margin="5,3,5,3"/>
        </StackPanel>

        <DockPanel Grid.Row="2" Grid.RowSpan="2">
            <TabControl x:Name="tabControl">
                <!--Series-->
                <TabItem x:Name="tabItemSerises" 
                         Header="Series"
                         DataContext="{Binding Series, Source={StaticResource Locator}}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="31" />
                            <RowDefinition Height="394*" />
                        </Grid.RowDefinitions>
                        <StackPanel Orientation="Horizontal" 
                                    Grid.Row="0">
                                <CheckBox Content="720p"
                                          IsChecked="{Binding Path=HDReader, Mode=TwoWay}"
                                          Margin="5"
                                          Command="{Binding Path=ResolutionFilterCommand}"/>
                                <CheckBox Content="1080p"
                                          IsChecked="{Binding Path=FullHD, Mode=TwoWay}"
                                          Margin="5"
                                          Command="{Binding Path=ResolutionFilterCommand}"/>
                            </StackPanel>
                            <DataGrid x:Name="dataGridSerien" 
                                  CanUserReorderColumns="True"
                                  AlternatingRowBackground="LightGray" 
                                  AlternationCount="2"
                                  AutoGenerateColumns="False" 
                                  Grid.Row="1"
                                  ItemsSource="{Binding Series}">
                                <DataGrid.Columns>
                                    <DataGridTextColumn Header="Language" 
                                                        Binding="{Binding Path=Language}" 
                                                        IsReadOnly="True"/>
                                    <DataGridTextColumn Header="Title" 
                                                        Binding="{Binding Path=Title}" 
                                                        IsReadOnly="True"/>
                                    <DataGridHyperlinkColumn Header="Link" 
                                                             Binding="{Binding Path=Link}" 
                                                             IsReadOnly="True"
                                                             CanUserSort="False">
                                        <DataGridHyperlinkColumn.ElementStyle>
                                            <Style TargetType="TextBlock">
                                                <EventSetter Event="Hyperlink.Click" Handler="OnHyperlink_Click"/>
                                            </Style>
                                        </DataGridHyperlinkColumn.ElementStyle>
                                    </DataGridHyperlinkColumn>
                                </DataGrid.Columns>
                            </DataGrid>
                        <ProgressBar Width="110"
                                     Height="30"
                                     IsIndeterminate="True"
                                     Visibility="{Binding Path=ProgressBarVisible}" 
                                     Margin="404,167,404,197" 
                                     Grid.Row="1" />
                    </Grid>
                </TabItem>
                <!--Movies-->
                <TabItem x:Name="tabItemTvMovies" 
                         Header="TV-Movies"
                         DataContext="{Binding Movies, Source={StaticResource Locator}}">
                    <DataGrid x:Name="dataGridTvMovies" 
                              CanUserReorderColumns="True" 
                              AlternatingRowBackground="LightGray" 
                              AlternationCount="2"
                              AutoGenerateColumns="False" 
                              ItemsSource="{Binding Path=Movies}">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Language" Binding="{Binding Path=Language}" IsReadOnly="True"/>
                            <DataGridTextColumn Header="Title" Binding="{Binding Path=Title}" IsReadOnly="True"/>
                            <DataGridHyperlinkColumn Header="Link" Binding="{Binding Path=Link}" IsReadOnly="True" CanUserSort="False">
                                <DataGridHyperlinkColumn.ElementStyle>
                                    <Style TargetType="TextBlock">
                                        <!--<EventSetter Event="Hyperlink.Click" Handler="OnHyperlink_Click"/>-->
                                    </Style>
                                </DataGridHyperlinkColumn.ElementStyle>
                            </DataGridHyperlinkColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </TabItem>
            </TabControl>
        </DockPanel>
    </Grid>
</Window>
